home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / msysjour / vol03 / 05 / filter / skel.c < prev    next >
C/C++ Source or Header  |  1988-02-01  |  2KB  |  78 lines

  1. /*  skel.c - skeleton for loadable Z extension
  2.  *
  3.  *  Extensions have three components, defined in this order:
  4.  *
  5.  *    Editor functions.  These are commands that can be attached to
  6.  *        keys and are invoked when those keys are struck.  These functions
  7.  *        have 5 arguments:
  8.  *
  9.  *        arg - the keystroke that was used to invoke the function.
  10.  *        cArg - the number of <arg> commands that have been issued before
  11.  *        this function.
  12.  *        argType - the class of argument that has been read.  This is one
  13.  *        of the following:
  14.  *        NOARG - no arg was given
  15.  *        LINEARG - the cursor is in the same column as the original arg
  16.  *            but on a different line
  17.  *        STREAMARG - the cursor is in the same line as the original arg
  18.  *            but in a different column.
  19.  *        NULLARG - the cursor is in the same place as the original arg
  20.  *        BOXARG - the cursor is on a different line and in a different
  21.  *            column
  22.  *        TEXTARG - the user has handed in some text.
  23.  *        pText - a far pointer to a NUL-terminated string that indicates
  24.  *        the special text involved.  This has meaning ONLY for
  25.  *        NULLARG, STREAMARG, and TEXTARG.
  26.  *        fMeta - the value of the flag controlled by the <meta> command.
  27.  *
  28.  *        Editor functions are expected to return a boolean value indicating
  29.  *        success or failure.  Typically, TRUE is returned in the normal case.
  30.  *        These values can be tested inside of macros.
  31.  *
  32.  *    Command description table.  This is a vector of command descriptions
  33.  *        that contain the textual name of the function (for user assignment),
  34.  *        the function to be called, and some data describing the type of
  35.  *        arguments that the function can take.
  36.  *
  37.  *    WhenLoaded function.  This function is called whenever the extension
  38.  *        is loaded into memory.
  39.  *
  40.  *  Modifications
  41.  *
  42.  *    16-Jan-1987 mz    Add pascal typing
  43.  *            Export switch set
  44.  *    21-May-1987 bw    Add return from WhenLoaded for OS/2
  45.  *    22-Oct-1987 mz    Correct definitions as headers
  46.  *
  47.  */
  48.  
  49. #include "ext.h"
  50.  
  51. #define TRUE    -1
  52. #define FALSE    0
  53. #define NULL    ((char *) 0)
  54.  
  55. flagType pascal EXTERNAL Skel (argData, pArg, fMeta)
  56. unsigned int argData;
  57. ARG far * pArg;
  58. flagType fMeta;
  59. {
  60.     return TRUE;
  61. }
  62.  
  63. struct swiDesc    swiTable[] =
  64. {
  65.     {    NULL, NULL, NULL    }
  66. };
  67.  
  68. struct cmdDesc    cmdTable[] =
  69. {
  70.     {"skel",Skel,0,    NOARG                            },
  71.     {NULL,  NULL,NULL, NULL                            }
  72. };
  73.  
  74. WhenLoaded ()
  75. {
  76.     return TRUE;
  77. }
  78.